<?php session_start(); ?>

<?php

include "Connect.php";

$recordName = $_POST['recordName'];
$recordPrice = $_POST['recordPrice'];

$hiddenField = $_POST['hiddenField'];

$Updt = $_POST['Updt'];

$b = $_SESSION['hG'];
//$d = $_SESSION['ID'];

if(isset($Updt)){

$up = mysql_query("UPDATE ".$b." SET Name = '$recordName' WHERE ID = $hiddenField ") or die(mysql_error());

$up2 = mysql_query("UPDATE ".$b." SET Price = $recordPrice WHERE ID = $hiddenField ") or die(mysql_error());

//$up = mysql_query("UPDATE ".$b." SET Name = ".$recordName. ", "." Price = ".$recordPrice." WHERE ID = '$hiddenField' ") or die(mysql_error());


//$up = mysql_query("UPDATE ".$b." SET Name = ".$recordName.".," ".Price = ".$recordPrice." " WHERE ID = ".$d." ") or die(mysql_error());

//$up2 = mysql_query("UPDATE ".$b." SET  Price = ".$recordPrice." WHERE ID = ".$d." ") or die(mysql_error());

if($up and $up2){
$msg =  "Record updated successfully";
header("location:editStuff.php?poll=$msg");

}else{
$msg =  "Update failed!!";
header("location:editStuff.php?poll=$msg");
}

   }


?>